﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HotelRegistrationSystem.Models
{
    public class RoomReservationModel
    {
        [DataType(DataType.DateTime)]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0: dd MM yyyy}")]
        public DateTime StartDate { get; set; }
        [DataType(DataType.DateTime)]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0: dd MM yyyy}")]
        public DateTime EndDate { get; set; }
        public int GuestsCount { get; set; }
        [Display(Name = "Hotel Name:")]
        public String HotelName { get; set; }
        public int HotelId { get; set; }
        public List<OneRoomReservationModel> Rooms { get; set; }
    }

    public class OneRoomReservationModel
    {
        public int RoomId { get; set; }
        [Display(Name = "Room Name")]
        public string RoomName { get; set; }
        [Display(Name = "Bed Count")]
        public int BedCount { get; set; }
        public Nullable<decimal> Price { get; set; }
        [Display(Name = "Room Type")]
        public RoomTypeModel RoomType { get; set; }
        public int RoomTypeId { get; set; }
        public List<OneReservationModel> Reservations { get; set; }
        public bool Reserved { get; set; }
        [Display(Name = "Selected Bed Count")]
        public int SelectedBedCount { get; set; }
        public OneRoomReservationModel()
        {
            SelectedBedCount = -1;
        }
    }

    public class OneReservationModel
    {
        public DateTime StartDate { get; set; }
        public int Period { get; set; }
        public int ReservationStatusId { get; set; }
        public int BedCount { get; set; }
    }

    public class RoomTypeModel
    {
        public int RoomTypeId { get; set; }
        public string Type { get; set; }
        public bool ReserveWhole { get; set; }
    }

    public class RoomHotelModel
    {
        public int RoomId { get; set; }

        public int HotelId { get; set; }

        [Required]
        public string Name { get; set; }

        public Nullable<decimal> Price { get; set; }

        public string Desciption { get; set; }

        public int RoomTypeId { get; set; }

        public RoomTypeModel RoomType { get; set; }

        public int BedCount { get; set; }
    }

    public class ReservationOptions
    {
        public int HotelId { get; set; }
        public Dictionary<int, KeyValuePair<int, bool>> ReservedRooms { get; set; }
    }
}